﻿using MathFlowLib.FeatureJudge;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace MathFlowLib.Converter
{
    internal class EnumBinToBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            E_Bin bin = (E_Bin)value;
            switch (bin)
            {
                case E_Bin.NG:
                    return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b92929"));
                case E_Bin.OK:
                    return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00b853"));
                default:
                    return null;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
